package com.fml.dataStructure.sort.util;

import org.omg.CORBA.Object;

import java.util.List;

/**
 * 小小工具类，免得重复写轮子
 */
public class SortUtils {
    public static void swap(int[] sort, int i ,int j) {
        int temp;
        temp = sort[i];
        sort[i] = sort[j];
        sort[j] = temp;
    }


    public  static void printArray(int[] sort) {
        for (int i : sort) {
            System.out.print(i + ",");
        }
        System.out.println();
        System.out.println("==============打印完成==============");
    }

    public  static void printlist(List<Object> list) {
        for (Object object : list) {
            System.out.printf(object + ",");
        }
        System.out.println();
        System.out.println("==============打印完成==============");
    }


    /**
     * 交换 char字符
     * @param s
     * @param start
     * @param end
     */
    public static void swap(char[] s, int start, int end) {
        char temp = s[start];
        s[start] = s[end];
        s[end] = temp;
    }
}
